﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WeekWork929.Api.Read.Appliaction.Commond;
using WeekWork929.Api.Read.Dto;
using WeekWork929.ErrorCode;

namespace WeekWork929.Api.Read.Controllers
{
    /// <summary>
    /// Api-读
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class QueryController : ControllerBase
    {
        IMediator mediator;
        public QueryController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 显示部门信息
        /// </summary>
        /// <param name="request">请求</param>
        /// <returns>返回显示信息</returns>
        [HttpGet]
        public Task<ApiResult<ApiPaging<ShowMeaDto>>> ShowMead([FromQuery]ShowMeason request)
        {
            return mediator.Send(request);
        }
        /// <summary>
        /// 展示岗位信息
        /// </summary>
        /// <param name="request">请求</param>
        /// <returns>返回显示信息</returns>
        [HttpGet]
        public Task<ApiResult<ApiPaging<WorkDto>>> ShowWork([FromQuery] ShowWorkCommond request)
        {
            return mediator.Send(request);
        }
    }
}
